package com.mt.grand.factory.simple;

import com.mt.grand.factory.domain.Apple;
import com.mt.grand.factory.domain.Food;
import com.mt.grand.factory.domain.Orange;

public class SimpleFactory {

    public Food getFood(String name){
        if("Apple".equals(name)){
            return new Apple();
        }else if("Orange".equals(name)){
            return new Orange();
        }else {
            return null;
        }
    }

}
